package com.pateo.bjev.contacts.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

/**
 * Created by pateo on 17-5-9.
 */

public class BtPagerFragmentAdapter extends FragmentPagerAdapter {

    Fragment[] fragments;

    public BtPagerFragmentAdapter(FragmentManager fm,Fragment[] fragments) {
        super(fm);
        this.fragments = fragments;
    }

    @Override
    public Fragment getItem(int position) {
        if(fragments!=null){
            return fragments[position];
        }
        return null;
    }

    @Override
    public int getCount() {
        if(fragments!=null){
            return fragments.length;
        }
        return 0;
    }
}
